package de.tu_darmstadt.informatik.tk.lernsystem.util;

import java.util.ResourceBundle;

/**
 * Config file reader.
 * Reads settings.properties file.
 */
public class Config {
	private static Config instance;
	private ResourceBundle properties;
	
	private Config() {
		this.properties = ResourceBundle.getBundle("META-INF/settings");
	}
	
	public String getString(String key) {
		return this.properties.getString(key);
	}
	
	public Boolean getBoolean(String key) {
		return new Boolean(getString(key));
	}
	
	public boolean containsKey(String key) {
		return this.properties.containsKey(key);
	}
	
	public static Config getInstance() {
		if (Config.instance == null) {
			Config.instance = new Config();
		}
		return Config.instance;
	}
}
